<?php
//------------------------------------------------------------------------------
// File              : V_Addmin
// Modification       :
//------------------------------------------------------------------------------
// Date(yyyy.mm.dd)   Developer                       Action
//------------------------------------------------------------------------------
// 2007.03.05         ThanhTX                      Created
//------------------------------------------------------------------------------
?>
<script>
function Check() {
	if (document.f.ho_ten.value.length=="") {
		alert("<?=NAME_NOT_NULL?>");
		alert('hello');
		document.f.ho_ten.focus();
		return false;
	}
	if (document.f.ten_dang_nhap.value.length=="") {
		alert("<?=NAME_LOGIN_NOT_NULL?>");
		document.f.ten_dang_nhap.focus();
		return false;
	}
	if (document.f.mat_khau.value.length=="") {
		alert("<?=PASSWORD_NOT_NULL?>");
		document.f.mat_khau.focus();
		return false;
	}
	if (document.f.mat_khau.value.length<6) {
		alert("<?=PASWORD_SIZE?>");
		document.f.mat_khau.focus();
		return false;
	}
	if (document.f.go_lai_mat_khau.value.length=="") {
		alert("<?=COMFIG_PASWORD_NOT_NULL?>");
		document.f.go_lai_mat_khau.focus();
		return false;
	}
	
	if (document.f.go_lai_mat_khau.value.length<6) {
		alert("<?=PASWORD_COMFIG_SIZE?>");
		document.f.go_lai_mat_khau.focus();
		return false;
	}
	if (document.f.mat_khau.value!=document.f.go_lai_mat_khau.value) {
		alert("<?=COMFIG_PASWORD_AND_PASSWORD_NOT_SAME?>");
		document.f.go_lai_mat_khau.focus();
		return false;
	}
}
</script>
<script language = 'JavaScript' >
function backToList(){
 	location = '<?="?".MODUL."=admin&".ACTION."="."List"?>';
 	return;
}
</script>
<?php
function V_AdminAdd(&$arrayData,$mode="Add"){
	global $arrayError;
	$ulr = "?".MODUL."=admin&".ACTION."=".$mode;//htmlspecialchars($_SERVER['QUERY_STRING']);
	$strButtonLabel ="    Save    ";
	?>
	<?= CM_showError() ?>
	<link href="../../../css/base.css" rel="stylesheet" type="text/css">
	
    <style type="text/css">
<!--
.style1 {
	font-size: 12px;
	color: #000099;
}
.style2 {color: #000099}
-->
    </style>
<table border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#FF9900" bordercolordark="white">
<form action="<?=$ulr?>" method="post" name="f" id="f" onsubmit="return Check();">
	<input type="hidden" name="id" value="<?=htmlspecialchars($arrayData["id"])?>" />       
	    <tr>
          <td colspan="2" bgcolor="#FFE59F"  class=bk12-140 ><div align="center"><font color="#000033"><strong>Tạo mới Tài Khoản</strong></font></div></td>
        </tr>
        <tr>
          <td width="130" bgcolor="#FFE59F"  class=bk12-140 ><span class="style1">T&ecirc;n</span></td> 
          <td width="270"><input name="ho_ten" type="text" class="form200" id="ho_ten" value="" size="45" /></td>
        </tr>
        <tr>
          <td bgcolor="#FFE59F"  class=bk12-140 ><span class="style1">T&ecirc;n đăng nhập</span></td> 
          <td><input name="ten_dang_nhap" type="text" class="form200" id="ten_dang_nhap" value="" size="45" /></td>
        </tr> 
        <tr>
          <td bgcolor="#FFE59F"  class=bk12-140><span class="style1">Mật kh&#7849;u</span></td> 
          <td>
            <input name="mat_khau" type="password" class="form200" id="mat_khau" value="" size="45" />
		  </td>
		  
        </tr>
		 <tr>
		   <td bgcolor="#FFE59F"  class=bk12-140><span class="style1"> Nhập lại mật mhẩu</span></td> 
           <td>
			<input name="go_lai_mat_khau" type="password" class="form200" id="go_lai_mat_khau" value="" size="45" /></td>  
        </tr>
        <tr>
          <td colspan="2"><div align="center">
            <input name="Reset" class="input_btn" type="reset" value="  Nhập lại " />
            <input name="Submit" class="input_btn" type="submit" value="Thêm mới ">            
            <input name="boqua" class="input_btn" type="reset" id="boqua" value=" Trở lại  " onClick="javascript: return backToList();">
          </div></td> 
        </tr>
</form>   
</table>
<?php
}
?>
